package com.wanshi.cloud.feign;


import com.wanshi.cloud.entity.Orders;
import com.wanshi.cloud.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 顽石教育-www.wanshi.com
 * @since 2021-05-12
 */
@RestController
@RequestMapping("/feign/order")
public class FeignOrderController {


    @Autowired
    private IOrderService orderService;

    //1 根据userId查询用户
    @GetMapping("/user/{userId}")
    public List<Orders> findByUserId(@PathVariable("userId") Integer userId){
        return orderService.findByUserId(userId);
    }


}
